﻿/*********************弘石项目三组************************
*  功能描述：绩效管理：项目人员进度和项目考核记录
*  作者：刘伟康
*  时间：2021-12-21
*  修改人：刘伟康
*  修改时间：2021-12-21
*********************弘石项目三组************************/
using Hong.Business.Business_AssessmentManagement;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace WeHongshibApI.Controllers.Controllers_AssessmentManagement
{
    [ApiExplorerSettings(GroupName = "Assessment")]
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class AssProgresController : ControllerBase
    {
        #region 构造器注入
        private readonly AssProgresBusiness _dal;
        public AssProgresController(AssProgresBusiness dal)
        {
            _dal = dal;
        }
        #endregion
        #region 项目人员进度和项目考核记录显示
        /// <summary>
        /// 项目人员进度和项目考核记录显示
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetViewPrjectLists(string id, int pageIndex = 1, int pageSize = 8)
        {
            int totalCount = 0;
            var list = _dal.GetViewPrjectLists(id,out totalCount,pageIndex,pageSize);
            return Ok(new { list,totalCount});
        }

        #region 反填
        /// <summary>
        /// 反填
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetAssProgressFT(int id)
        {
            var list = _dal.GetAssProgressFT(id);
            return Ok(list);
        }
        #endregion

        #region 审批状态
        /// <summary>
        /// 审批状态
        /// </summary>
        /// <returns></returns>
        [HttpPut]
        public IActionResult PutAssProgress(int id)
        {
            var i = _dal.PutAssProgress(id);
            return Ok(i);
        }
        #endregion

        #region 批量发起
        /// <summary>
        /// 批量发起
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        [HttpPut]
        public IActionResult PutAssProgress1(string ids)
        {
            var i = _dal.PutAssProgress1(ids);
            return Ok(i);
        }

        #endregion
        #endregion
    }
}
